Skip to main content

Disambiguation Methods

Overview

To incorporate a disambiguation method there are two core steps:

  1. Leverage an LLM to identify all the "topics" within a particular data corpus and its relevant entities.
  2. Build watsonx assistant actions for each identified "topic" in the data corpus and create a step to provide all the relevant entities as options to the user when a topic is mentioned by the end user.
  3. Combine the user's selected option with their document search request and present the clarified answer to them.

How to Implement

  1. Leverage a python script and the watsonx sdk to determine all the topics within a data corpus and the relevant entities.

    Example Topics/Entities:

    TopicEntities
    BrowserChrome, Safari, Firefox
    DevicesiPhone, Android
    Printermodel A, model B
  2. Build watsonx Assistant actions for each topic and build a step to surface the entities as options to the user

  3. Build another step within the watsonx Assistant action to store the selected option as a variable, for example as "selected_option"

  4. Combine the user's "selected option" with the document search request

    For example, if the variable "user_query" holds the user's original question, such as "How do I clear my browser cache?", you'll need to append the selected option to the "user_query" variable before sending the clarified query to the "Document Search" method.

    Example)

    user_query.append(" on").append(selected_option)

    This will result in the the final query to the "Document Search" method to look like: "How do I clear my browser cache on Safari" which will then return the most appropriate answer.